home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / misc / math / EqEd.lha / EqEd / rexx / EqEdFront.rexx next >
Encoding:
OS/2 REXX Batch file  |  1995-05-18  |  1.1 KB  |  53 lines

  1. /* EqEdFront.rexx -- This script is for opening EqEd in FW.
  2.  * If you have selected a graphics object in FW, this script will try to find out
  3.  * if it is an equation and if so, load the native version into EqEd.
  4.  *
  5.  * Make sure to assign EQED: to the directory where you installed EqEd.
  6.  *
  7.  * Made by David Shaffer and some minor adjustments by Brian Petersen.
  8.  */
  9.  
  10. /* Check for FinalWriter */
  11. options results
  12. if ~show('p','FINALW.1') then
  13.   do
  14.     say 'I should be used only when FinalWriter is running'
  15.     exit
  16.   end
  17.  
  18. /* Start EqEd if it isn't running */
  19. lf = '0a'x
  20. IF ~SHOW('p','EQED.1') THEN
  21.   DO
  22.    ADDRESS COMMAND "cd eqed:"||lf||"run EqEd"
  23.    ADDRESS COMMAND wait 5
  24.   END
  25.  
  26. /* Check to see if a graphics object is selected in FW */
  27. address 'FINALW.1'
  28. currentobject
  29. co = result
  30. eqname = ''
  31. if co ~= 0 then
  32.   do
  33.     getobjecttitle co
  34.     eqname = result
  35.   end
  36.  
  37. /* Now get EqEd's attention and load the equation if it exists */
  38. ADDRESS "EQED.1"
  39.  
  40. EQEDTOFRONT
  41.  
  42. if eqname ~= '' then
  43.   do
  44.     if exists(eqname) then
  45.       do
  46.         setname eqname
  47.         load
  48.       end
  49.   end
  50. else
  51.   'new'
  52.  
  53.